const { ccclass, property } = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;

    @property
    tmplID: number = 0;

    @property
    itemID: number = 0;


    onLoad() {
        this.node.on('touchend', function () {
            console.log("Item " + this.itemID + ' clicked');
        }, this);
    }

    start() {

    }
    initItem(tmplID:number, itemID:number) {
        this.tmplID = tmplID;
        this.itemID = itemID;
        this.label.string='view'+tmplID+'#'+itemID;
    }

    updateItem(itemID:number) {
        this.itemID = itemID;
    }

    // update (dt) {}
}
